<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up()
    {
        Schema::create('wechat_users', function (Blueprint $table) {
            $table->id();
            $table->string('openid')->unique();
            $table->string('session_key');
            $table->string('nickname')->nullable();
            $table->string('avatar')->nullable();
            $table->tinyInteger('gender')->nullable();
            $table->string('country')->nullable();
            $table->string('province')->nullable();
            $table->string('city')->nullable();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('wechat_users');
    }
}; 